Make sure MAX_PYR_LEVELS is large enough