gd: fix typo and cleanups