Fixed some errors in downsampler.py, etc.