Moved RegEdit error handling to Main()