Completes bug #81.
Also addresses enhancement #66. (further error correction)