top: add sizeof(G) check; fix style