Fixed type issues when serialization changed.

Type mapping allows for nearest type identification.