backport bytebounds fix to 1.8