Improved deserialization performance when using classes.

Signed-off-by: rpgmaker <olamide.bakre@gmail.com>