Optimizations and bug fixes.
Some minor balancing.