Fix issue when advanced api is not available #29
Hopefully fixed some errors when connecting to sockets which does not response. #38