Fixed issue #10
Fixed issue #13
Fixed issue #25