Fix for bug #312.