Performance tuning

Performance tweaks to help mitigate #10.