My guess as to the cause: a more recent version of javascript (or an internet browser?) created some kind of way where, even though k is a positive integer, if(k) might be false but if(k>0) might be true. The problem with the scrambler didn't happen before because this wasn't an issue before.