Fix warning with missing write ret value check
Fix warning with uninitialized variable
fix warning with uninitialized variable