Add error and range checks to parse_range am: 806f72f9e6  -s ours
am: 81faa274d0

* commit '81faa274d0c3e36eb68b4a436695047949130d70':
  Add error and range checks to parse_range