Small clean-ups and fixes