Speed optimizations. v0.3.1