Fix for issue #5 and issue #10.