More improvements to the maximum overlay size code