Lots of initial fixes