Implement checks around message counter

fixes #125