Add test for bug 507998

This test should allow the closing of bug 507998