Fix template compilation issue