Removes unused variables in fastamg.