Speedup fix from @fluff