compile with -Wall -Werror and fix errors