Fixed bug where child functions wouldn't nest more than one level