Bug fixes

The original code was not tested, now CONNECT message is tested…