Proposed fix for bug #513