Fix for issue #81
(cherry picked from commit 1ef5b06)
Fix for issue #82
(cherry picked from commit 597cb83)