fix bugs resulting from getting rid of replicas
fix bugs resulting from getting rid of replicas

tscholl2/smc,sagemathinc/smc,sagemathinc/smc,tscholl2/smc,tscholl2/smc,tscholl2/smc,DrXyzzy/smc,DrXyzzy/smc,DrXyzzy/smc,sagemathinc/smc,DrXyzzy/smc,sagemathinc/smc,tscholl2/smc