fix trailing space and quoting interaction