Fixed bugs regarding cp weight