Merge branch '2023-08-08-assorted-code-corrections' into next

- A number of code corrections caught by Smatch and a few others as
  well.