Fixed issue #114 and #135