Make sure g is empty before rendering the node