Fixes upserting