Made maxContext update correctly on extension of contexts.