Fixing template compilation error