correct errors and warnings