fixed compiler errors and warnings