Bunch of compile fixes