fix a bug in S.shrinkSpace