fix all warnings and add -Werror