Fix issue #1166.