fix typos and compile errors