Return non-zero for bad or insufficient parameters

This is for #676.

@Renelvon PTAL.