Fixed typos in the comments and the Exception. Also fixed if condition to check registry