Adds check to ensure terminal states aren't expanded in the tree.