Made fixes to PBJ optimization mechanism