Fix for Bug: Indefinite block in DefaultConnectionStrategy.getInternalConnection()

Thanks: Chris Ng
A few cleanups + bug fixes