When mortgage modifications like Hamp come into play, that traditional priority order is reversed. The borrower is paying the Hamp-modified (i.e. lower) first lien amount, and the full second lien amount, so the second lien effectively becomes senior to the first.
When principal reduction comes into play, the problem becomes even starker. Current rules say that first lien mortgages can't be written down before the second.