QM fixed and other fixes