Fixed constraint bug