Just stumbling by. There is a broadcasting bug/subtlety in the test. Are you sure that `A[Z1]` returns an empty 1-d array? The code change above looks like it returns a scalar, which the test would miss.