bugs fixes + constraints support