improved error handling
Merge branch 'master' of github.com:agentio/agent