Fix for mods counting.
Fix for #4011.
Merge pull request #4372 from Segrain/master

Small fixes.