Fixed bug (optimizing Sub nodes led to invalid results)