Fixed several warnings.
Fixed remaining warnings.
Enabled -Werror on clang.