Fixed another case when removing casts