Fix incorrect code listing in docs

Plus some minor spelling.