Typecheck fix.
Merge pull request #3613 from Segrain/master

Tinyfix.