Fix constraints functions