It would be good to have some documentation on this function.
Also, I think this function does more than just "check," doesn't it?
Check functions are usually predicates, this operates on given arguments.
Something like fixupNestedLists() would be more descriptive.