Fix a bunch of errors