some tweaks to conditionals

I noticed a couple of things that look like bugs and suggested a couple of ways to make things clearer.

Another general note, the expression x++ "returns" the old value of x, while ++x "returns" the new value. In the absence of optimizations that arrange to throw away the return value if it's not used, the latter is more efficient. (this matters more in C++ where x++ implies at least an implicit copy of the object before ++ is applied). In my opinion "Increment x" is better written as "++x" than "x++" unless you really need the value before it's incremented.