Minor bug fixes.

* From the upsert remove conditions that are assignable like $gt and $lt
* Make sure if the model is undefined during a $lt comparision, its set to 0
  first.