Improve Range handling

Add support for 416 and fix some corner cases.