Fixed constraints building for two-classes problems.