sexp: Improve argument checking of sexp parser.