Fixed redundant cast issue bug.