Fix for #1094

Timerange fix
I think we should add some input checking here. Something along the lines of, if b is not specified check that a is iterable or raise a nice error.