(b)A guarantees C against the misconduct of B in an office to which B is appointed by C, and of which the duties are defined by an Act of the Legislature. By a subsequent Act, the nature of the office is materially altered. Afterwards, B misconducts himself. A is discharged by the change from future liability under his guarantee, though the misconduct of B is in respect of a duty not affected by the later Act.