Fix wrong calculation of spaces in storage.

Fix #117