Fix page bar generator bugs