Remove useless castings