Fix typos and add documentation