gfx_wait returns integer. Fixed graph_square function