Fixed a bug in computing the pages' role.