fix some unsafe in light, some optim, add function in AObject