Fix for issue #82.

This is tested and seems to fix the problem reported in issue #82.