Fixed various glitches