fix a lot of errors