Fixed bug that did not gather type propperly on restore.