Fix assignment and html_safe call