Minor bug fixes and Improvements