Made erase_range callbacks use enum types. Plus other minor stylistic fixes.