Removes unecessary type casts.