Fixed bug of fetching Cursor from closed database.
Closed all Cursors which were left opened.