Fixed sorting bug, modified adding/removing pages/ranges methods.