Thanks, I did what you said and the ligand fits beautifully into the cavity. Just out of curiosity, does  automodel.nonstd_restraints() apply only to BLK residues? I tried to override this function to build models with ATP but Modeller always seems to define its own restraints. Do I always have to do that trick with moving the ligand far from the protein, as described in the advanced tutorial?