Ensure registry key exists when in Debug mode

Check out issue #562