Fix variable declaration

And also use `Doctrine` instead of `Doctrine_Core`.