Fix to allow using tsobject in function heads