Fixed multiple issues in template administration

Fixes #1247