At about this time, young Ludwig van Beethoven arrived in Vienna and also took lessons from Haydn and Albrechtsberger, thus becoming a fellow student and a friend. Beethoven's arrival was said to have nearly destroyed Hummel's self-confidence, though he recovered without much harm. The two men's friendship was marked by ups and downs, but developed into reconciliation and mutual respect. Hummel visited Beethoven in Vienna on several occasions with his wife Elisabeth and pupil Ferdinand Hiller. At Beethoven's wish, Hummel improvised at the great man's memorial concert. It was at this event that he made friends with Franz Schubert, who dedicated his last three piano sonatas to Hummel. However, since both composers had died by the time of the sonatas' first publication, the publishers changed the dedication to Robert Schumann, who was still active at the time.