fix bug in min/max size constraint generation