Fix #1027
Test for #1027