Fix issue #1277