Added an exception handler to the controller, and updated the ditch.py script to be more robust.