Fix IndexMissingException in get template request

Fixes #2873