Add some tests for utils

I noticed a few easy wins while looking through test coverage reports.