Fix to handle common EC2 errors.