Fix bugs in cgb.mod.lib