Fix build and various random fixes