As we were discussing on the status call: setting shell options in the shebang is not the same as setting them with set.
Setting options in the shebang of a script only sets them if called as a script (i.e. ./script.sh). It does not set the options when called with sh script.sh or bash script.sh. To replicate the shebang options, you have to call the shell with the same options (i.e. sh -x script.sh).
Enam