Fixed bugs in auto magic complete