Fix escape detection