Fix more error handling