Code cleaning and spelling improvements