Code updates for bug fixes

Code updates for bug fixes