Fix upsert function to actually work (iknowrite?)

 * Closes #49
Merge pull request #62 from vlucas/fix_upsert

Fix upsert function to actually work (iknowrite?)