Fix errors when compiling with -Wall