Update KeyCastr

Closes #7542.
Merge pull request #7548 from vitorgalvao/fix-7542

Update KeyCastr