[PATCH] network: ensure nparams is non-negative