Fix nested input many problem and fix final tests