modify doctests and add tests for nargs