Now catching on exceptions and fixing pep8 violations

Now the script shouldn't die during the night and need restarting.  Hooray.