Added some restore code.
Merge branch 'test' into dev