fixed lots of compile time errors