Fix page bar generator and page blocks bugs