Handle dimension correctly for template functions.