Some random simplifications and cleanup.