test and fix erroneous whitespace skipping bug