fixes for having index based functions in the object declaration.
improvements for header collapse