Fix a bunch of errors @mdb found