Fixed non-looping P5b issue in localOptimum()