Test and fix utility functions

Coding on a plane has its advantages and disadvantages.