clean up test + added error handling on malformed lists and dicts