Fix some bugs with parent assignment