More work on restore ownership code.