cleaned up the way the max log size stuff works and fixed a potential