Cleanup and fix html_safe