orm: Fix serious logic issue in the save() method