better error messages, refs jim's points
change some order