Fix minor errors in switch removal