Fix error handling, third time's a charm