Fixed bottlenecking, and other optimizations