Added assertion check on unpickling of D