Speed optimizations to sessionproxy.