Made the tests more tolerant for whitespace.
Better handling of newslines and whitespaces