This whole changeset is also from another bug, should have its own commit.