fix typo and missing lines