Fix #5570: Set prototype.constructor for all derived classes