fix handling of spaces in input expression