Log failed transitions instead of mailing them
Clean up code

Remove some unnecessary prints, and do some general cleanup
Merge logging of errors instead of mailing them