Fixed history query for model subclasses

Fixes issue #1524 (thank you github edit button!)