Better error messages, better sorting