Handle error-cases more neatly.