Fix page indexes + tests