Fix a division by zero

The bug only manifest at particular store size and memory configurations.
Merge remote-tracking branch 'neo/1.9-maint' into 2.0-merge-1.9