fixed bugs after bad manual merge