Added custom templates and bug fixes