Fix shape error in tests (which also means that we had wrong behavior).