Assignments to global registers should store the result in the global, not in the local register of the same number.

Fixes #1