Minor performance, scalability and correctness tweaks...