Minor error handling changes