Improved style
Fixed removing nonexisting nodes thrown exceptions