Fix some rendering glitches