Made various small changes to templates and JavaScript