Warning fixes (Clang)

Based off the GCC warning fixes branch, so you can discard that pull request if you decide to pull this.