Clang warning fixes; code cleanup