Test Trac #9565 and #9583