Fixed recalculating on player quit and plugin not working.
Also code cleanup.