minor cleanup and fix narrowing conversion error on clang