Fixes for memoryleaks in raster