Cleans bad code in #edit & #delete