Fixed write_page and read_page