Added test case to reproduce issue #1311.