Fixed bugs in qcdmrg code, it seems to be working