Added maxiter support.