Fixed a crash in case the script is empty.
Uncomment now not-crashing code
Moved members around