issue #5865: fix bugs of _space