fixed space handling in commands (issue #495)