Fixed a bug in Box.setParent.