Fix a type

Arguably a better fix for #716.
Merge pull request #717 from kirelagin/patch-4

Fix a type