Fixed issue #28
Fixed issue #45