Tidyup some error cases.