Fix for toggling code lists

Before, it always set the code state to “on” even though it would print
out “off”. The strings in the ternary operator were reversed.

Feeding in -1 as the second argument to SetCodeState toggles it, as
opposed to 0, which sets it to “on”.
Merge pull request #1 from jfktrey/master

Fix for toggling code lists