Convertred kvmqm low-level calls

... and fixed lots of errors on the way

re #658