Fix a small bug about key-constriants