Fixed some problems in dsFunctions.py