added policy checking on removing children or setInnerHTML. Fixed some bugs