fix a checked mode error
Merge pull request #3745 from devoncarew/devoncarew_fix_cast

fix a checked mode error