Fix type casting issues for Release target.