Fix typos.

Change-Id: I9b2658336ac4d66df7cf745b8d58d8d49813ec16
Improve logging code.

- Write to log buffer ourselves instead of calling log, so the printed
  pid is correct
- Reduce debug spam

Change-Id: I9afe7249fc589268ea61419a7cfc724897981e9e