Bug correction

* added tests
* incorrect message splitting corrected