Fixed bugs on abm grid