Fixed bug in counterexample generation