Fix removeRedundantAttributes.