A bunch of other fixes