Minor tweaks. Looks butt ugly, but generally does the right thing.