Merge "Fix calculation of empty spaces" into rvc-dev am: 6813206e6c am: 2248146de8 am: 7b8c083000

Change-Id: Ie47f27ca93b1dd00716a4ce884d6d79466dc1add