Miscellaneous cleanup/rearrangement.