numerous minor fixes from clang static analysis kvetching