Fixed database issues.