fixed some bugs in raster plotting