Add template and fix some errors with partials