Fix for bug #4999