a bugfix in message delivery to test + unit tests