Fixed database loading