Completely reworked qml.c, making it correctly recurse into tags.