More improvements. Things actually work now, but the screen flashes a bit.