fix some misuses of space partition code