Fix _glyph_functions

Same PR than #962 but changes in branch rather than fork.