LPS-37266 (and LPS-37281)

This pull contains many commits, but they are all very small and focused.

They are all about LPS-37266 except for one that fixes one bug (LPS-37281) that I found while working on this.