Fixed typos, fixing error handling.