Fix buggy model.set method