A proof and extension of Dehn's lemma