Remove type casts that are no longer needed