Fix type check in matrix3D setter