Modified hierarchy.pl to behave (slightly) better when dealing with files with potentially incorrect TSNs.