Fix some raster bugs.
Optimize vector form construction.