Changed serializable so it accepts a subclass of BaseType as type