Improve database test