fix all warnings and add -Werror

We can remove -Werror if we don't want that. Regardless, all warnings are fixed!