patch from SourceForge issue 520 was applied

fix for #76