Made MessageHandler public to allow customisation elsewhere.  Created
setter for incrementing error counter.