Llvm compiler warning fixes

Various minor fixes for warnings emitted by LLVM, I'm not aware of any problems these should cause in other compilers but I have only checked these on GCC/LLVM.