Bug fixes for the logic in handling things across versions.