Improving manopt function.