Added feature to add extra <criteria> node
Fixed some other stuff.