Fixes bug relating to accessing variables