Fix bug WRT inconsistent registers, bug #3062.