Fix number of loaded pages
Fix Python 2.5 support