Minor code cleanup

https://bugzilla.mozilla.org/show_bug.cgi?id=978670
Show correct error message if script file fails to open

https://bugzilla.mozilla.org/show_bug.cgi?id=978670