Update sphinxwrap.py with better input checking.