Removes trailling whitespaces and fixes some tests of test suite.

Currently tests 9, 17, 18, 19 and 23 fails (test 12 fails only in acumulative mode).