Minor fix for error handling.