Fix some errors and warnings when compiling with Clang
Merge pull request #446 from zrax/clang_fixes

Fix some errors and warnings when compiling with Clang