Fixed a bug where slicing had error because return was a float and not an iterable.