BoundsError if f[1] did not exist

Fixed a bug in case of filter() does not return anything and f is empty.