some fixes, mostly compatibility with new QL