Fix in range method and tests for it