improve handling of unreachable boxes