Fixed error message handling and updated docs

I've fixed error message handling. Error messages are removed when no longer valid.

I've also cleaned up the docs. There was a reference to regTest which is apparently no longer used.