Make sure uvw is initialized when sampling source position.
Fix bug in convert_xsdir.py.