Made the used vars local.

The Mnist constructor was unintentionally creating some global vars.