Add possible trailing whitespace and missing -D argument

Added test for trailing space case