fixed few warnings detected by LLVM clang compiler

some where pedantic and some were potential bugs