Fixed for loop attributes (limit and offset)
The scan helper returned attribute arguments as an array, which the constructor function was not expecting.
The slice function also seemed more complicated than necessary and did not work with the limit attribute.