Bug Fixes and Performance

Performance issues and bug fixes