fix error and warning