Fixed bug in ILP formulation