Minor fixes.
This is the currently active development branch
Minor code cleanup and fixes requested by aldood@gmail.com