Changing all global variable assignments to conditional assignments. Related: #2