Merge "Fix NPE during restore" into sc-dev