Fixes, performance enhancements and cleanups.
Nothing major.