peel_onion: do not assume length of x_type globals