The bond of each civil officer must be construed to cover duties imposed by laws passed subsequent to the execution of such bond as well as to those duties imposed at the time of the execution of the bond. No bond is void because of its failure to comply with the law as to matters of form or substance but it is valid as to all matters contained therein if it complies substantially with the law.