Fix for bug #1497.