Add workaround for working with legacy databases