Removes erroneous casting