Roof ornaments in Funchal, Madeira

MANY ROOFS IN FUNCHAL are covered with terracotta tiles. Quite a few of these roofs have small sculptures on their corners. Many of them depict heads, birds, and scrolls ( leaves?) I have no idea why these things are added to the roofs.

Someone suggested that these ornaments are supposed to deter mice, squirrels, and birds. Maybe, they are for that purpose. In India ornaments depicting ogre’s faces (‘rakshasa’) are atteched to roofs to ward off the Evil Eye. Possibly, this is a finction of the ornaments I have seen in Funchal. Another possible function of these roof ornaments (finials) might be to distinguish one house from another. However, I am not sure about this here in Funchal because there is little variety in the firms used.

I would love to know more about them: their purpose and history.