fixed issue #28, #29, #30 and #31