Improve restoring of context size and position Restore context size and position where it is modified, not in seemingly random places.