Code audit changes part 4

/cc @JonRowe