Fixed issues flagged by clang