Try adding /reg:64 to your reg.exe command (or calling into the Wow6432Node key on 64bit systems) to work around the issue. Give it a try to be sure, but I suspect you'd be safe leaving /reg:64 in place even on 32bit systems.
Also, as a general principal which applies to all programming languages, when detecting architecture, make sure to capture correctly all the cases where your app is 32bit on a 32bit system, 64bit on a 64bit system, and 32bit on a 64bit system under WOW64.