fix a subtle bug with multiple inheritance