bug fix: correctly convert ndim to proper enum type