fix handling of spaces in path (fix #519)