some more potential overflow fixes