Fix Clang static analysis errors

This covers #459 and #460.
Where did this go?