Speedup fix for Issue #340.