also fixed a bunch of things mangled by find-and-replace
I mean it doesnt work, but it also doesnt produce warnings