Merge pull request #157 from dennishendriksen/master

Various improvements
bug fix: close unauthorizedDatabase