Bug Fixes and Clean up