Add some pyramid code to make scan() more friendly.