Fix for bug #347