Fixed issue #79 and #78