Add in a couple of fixes with the osr register / scope ptr