A bunch of fixes and stuff