Removed some redundant function calls in NelderMead