fixed compiler errors with gcc