Change function MakeScriptExecutable

Change function MakeScriptExecutable to correctly to handle non-scripts.