Merged refs/pull/origin/1 by Alan Evans: Bug fix to make sure variables that are used are set and documentation improvements. Resolves #1