fixes addChild and addControl to work correctly with inBefore