Fixed issue #179

Annoyingly template changes were needed.