Small refactoring and bug caught in computation of "plast" which had the potential to cause slowness.