Fix some error handling warnings from the analyzer