Improve database testing and make import export work.