fix typos and improve warning messages.