Fix must-check warnings and implement a few error paths.
3 files changed