Update to work in modern world

Not much a real cleanup, but bare minimum to make sure things keep running.

Old code is embarrassing. :-/