Added parent class discovery and updated Long (de)serialization method