Clang fixes

Fix for clang build error and some warnings.