Merged your changes and Make some Bug Fixes

Merged your changes and Make some Bug Fixes