This fixes problems 1 and 2 outlined in issue #3 (closed) and replaces the fixes in merge request !25.
The pull request adds:
The pull request is passing tests and work on the code from issue #3 (closed)..