Fix a non-critical error and move functions