Fix some bugs in assignment

In particular:
1. <local-assignment> holds a reference, unlike <global-assignment>
2. I need to update the runtime environment with globals