Resolve duplicate records in `Model.refresh()`

This is a proposed fix for #458.