Fixing issue #84. Updated unit tests.
Fixing issue #82. Updated unit tests.
Fixing issue #86. Unit tests updated.