Merge "Simplify bubble z ordering and fix various issues" into main