Fix bug where odd states lead to odd size gradients