Trimming out trailing spaces in end columns, added basic test.