Gfx string

More bug fixing and refactoring of gfx_string functions.