Fixed API bugs for SMG.