Fix a couple of bugs pointed out by clang compiler warnings.