Fixed a number of compile errors