fixed a lot of compile errors