Remove empty g elements

Remove empty g elements since they have no effect in a document.