Fixed bug where the array was modified incorrectly during the feasibility check.