fixed NPE in Box.extendToEncompass, close #1783