fix amdmts total
ensure real zero
fix encoding, refacto, add count field per page
fix sort and missing page