Fixes parsing of $pages, it is now converted to int as it should be