Improvements

* Improved variable out of scopes
* Improved variable overwrites