Adjusted error message when database can not be opened.
Added basic tests for database opening