Bug Fixes and performance improvment