Fixed database layout errors.