Fixes and speedups
Speedup