Query and connect ports computation added, better exceptions handling, connect url support, some other improvements