Fixing some flickering issues