various cairo fixes