Fixed errors when compiling with gcc