(QENG-289) Raise error when template is nil
Merge pull request #168 from hunner/fix_pooled

(QENG-289) Raise error when template is nil