Fix compiler warnings

This pull request fixes tons of compiler warnings (as reported by `clang`).