Fixed issue #43 and #45