Fixes an Incorrect Type Cast