A couple fixes for Python XSTOOLs

Dave,

I had to make these changes for XSTOOLs to work for me. The first commit I think is definitely right, the second I'm not sure of at all, but it seemed to get me past a problem. More details in the commit logs.

                            Thanks,
                                 Steven