Bug fixes in pb_data and pb_page routines