Fix generation of JSON with combinations of -i/-p/-s