Amendments to allow nested calling of internal functions