Fixed issue #36
Added functionality in feature request #35
Fixed issue #38