Added more tests
fixed query to handle inf and -inf in ranges