Fixed pagination macro