smod() fix (internal)

smod() was failing frequently. Switched ternary to full conditional and
it works. wat