Overflow fixes

Lot of work for a simple late-discovery.