Allow spaces as thousands separator

Fixes issue #2230