Fixed pagination and loading rules from file.