Add filters and fix some bugs in Pages model.