Fixed.
Some performance optimizations. Add profiles.