Misc bit more cleanup. Also broke debug logging control again somehow recently, wee!