Box: Improve robustness of isValid()