Nested functions will now be correctly handled (See Walters comments).