Issue 505 - Close databases after open, create, and running queries