Fix template compilation