Bunch of minor compile fixes and changes