Fixed issues indicated by PyFlakes
Cleaned up doc/manualgen.py