Various glitch fixes