General fixes and updates - unified with the version of non-PGB