Fix issue #1024