Fixes and performance improvements.