Fix issue #1009