Test #8542
Test Trac #8537
Improved error messages