fixed some warnings and compile errors