Export variables after recursive call, fixes reference error.