Simplifying fileRange and adding many test cases.