Small optimizations to overlay.