Fixed issue #566