Fixed getPages() method to return an array of Page objects