Oh, I just realized that the mod operator isn't available in PulpScript. However, this thread contains a workaround.