Bugfix in tools/bounds [backport]