validation error rows sorted ... tests and library updated from Gaurav's files