Fix broken single row upsert + error handling that doesn't work properly