Draw function pointer checked before calling.
On get buffer method, cairo surface is called finished and flush
Header file formatted.
Dangling xmlnodes removed. To be checked if memory is freed correctly.
Return code added.