Make the conditional correct for print_prefix

Fixes a bug introduced on #1936.

Incidentally, converts from `&&` and `or` to `&&` and `||`

thx @jlee-r7 for spotting