More fixes and optimizations.