Merge pull request #1041 from hurtonm/master

Tell the session why the engine has stopped
Fix bug in reporting protocol errors