Implemented persistent connection ( pconnect ), minor fixes