fixes bunch of errors