Fixed up some bugs so it will compile