Merge "Fix calculation of empty spaces" into rvc-dev am: 6813206e6c

Change-Id: Idb455cf7908c0ddd3fbdb07e4014c011c0a5ac35