Handle differences between RangePositions and OffsetPositions.

This applies a code change from @edanl to address a change in behavior between Scala 2.10 and 2.11 for `Position`s. 

This change can be applied to both Scala 2.11 and Scala 2.10.