Fixed insert/replace detection in Model.save method.