Bugfix for issue with "filter"

The problem arises with element names that already exist as a function in Object class. It can be fixed by checking that the element is indeed an Array (and not a function) and otherwise overwriting the function.