Small fixes and tightening of canvas primitve drawing