Fixed bug in min effort. Added test.