Consistency of maximum likelihood estimation for some dynamical systems