fix some templates and returns