added fixes for range, and new test