Localized optimizations
Fix reply callback bug
Merge pull request #862 from spumko/perf

Minor performance tweaks