Fix typos, handle null document. Workaround busterjs race condition for now