bugfixes in quark handling