Added -Wall -Werror and -pedantic flags

Because of the change, some of the compilation warnings had to be fixed.