minor improvements in meanfield class