Fixing clang warnings and errors