Bug Fixes and performance improvements