Fixed nullshape indexing.
Closes #3310