Fixes scope bug in utility functions.