Unify error message sending.
Fix most of #1