Fix helper functions