Fixed issue #34
Fixed issue #39