fixed some glitches.