Connection string caching bug fixed.
Other minor fixex and some old code deleted.