Replaced sort -k2 by sort -k2,2, etc.