Properly resolved vars in generated script