In a two-sided matching market when agents on both sides have preferences the stability of the solution is typically the most important requirement. However, we may also face some distributional constraints with regard to the minimum number of assignees or the distribution of the assignees according to their types. These two requirements can be challenging to reconcile in practice. In this paper we describe two real applications, a project allocation problem and a workshop assignment problem, both involving some distributional constraints. We used integer programming techniques to find reasonably good solutions with regard to the stability and the distributional constraints. Our approach can be useful in a variety of different applications, such as resident allocation with lower quotas, controlled school choice or college admissions with affirmative action.