Fix reg issues

Order matters. You don't set it before using it.
Merge pull request #1 from LordRalex/patch-1

Fix reg issues