Fixed a NPE while deserializing objects