some bug fixes to raster.py and wrote a working unit test testRaster.py