Fix the template html.
Clean up the code, fix bugs.