Fix a bug in DataModel handling lock field.