Introduction of deus ex machina is a tell-tale sign of sloppy plotting.
Many Genres, One Craft: Lessons in Writing Popular FictionFiction wouldn't be much fun without its fair share of scoundrels, and they have to live somewhere.
The Well of Lost Plots