Add test for bug 507998