Corrected bug in the function that creates a terminal int node