Fix unversioned output being passed to -template

Closes #2241