Update paging.c: some fixes and changes