fixed bugs with multiline lists, more error checking