Fix escaping to use \ instead of /
Fix bugs introduced when splitting out pagination.py