Fix NPE if no modulo for std (handle cases before modulo.)
Merge pull request #1795 from jburel/npe-sdt

No modulo std