Fix spacing errors and typos in the code