Correct naming of defer.
Tidy up enums.
Document ranges a bit.