Refs #8305. Fixing cast.
Merge remote-tracking branch 'origin/bugfix/8305_deprecated_cast'