fix invalid dimensions being passed into prim_* (refs #41)