Fixed errors/warnings when compiling on gcc