Allow the collection to also be customized
Fix upsert() not exiting earlier for a failed update
Added last() to Query