Fixed a bug with getting the correct page position to move to