fixed a few minor issues found by clang