Fixed issue #565