Remove bad elements