Fixing slicing of functions