Fix for bug #589