Removes additional newlines so that if 2 objects are separated by an odd number of newlines one object does not get gain a newline at the start.
Added a parser for the legends section
Corrected error message from could to couldn't