Fixed crash when sorting by errors