On the automorphism group of certain algebraic varieties