Fixed success/fail flags and some stupid formatting from gedit