Fixed error in computation of memory space