Fixed inconsistencies with setting old attributes and pks

issue #2892
fixed test break, fixes #2892