Fixed issue #366