bug fixes for #720

This fixes most of the bugs re bug #720

The python code still uses hard-coded paths; someone needs to write new python code to look for modules in reasonable directories.