Fixed bug with helper functions.