Updated allocatePage, got rid of int comparison warning