Fix bug in get_ERs
Implemented tree_remove_small_ERs