Fix #1791
Test case