fixed compile time errors and warnings
fixed compile time errors and warnings