Imq is very invasive componemt which requires to recompile almost everyhing this diver is very unstable and will crash for sure, sooner or later depending on load. I sugest you to leave iptables alone and just modify imq.c source to catch what you need. ir you dont have too much trafic it may not crash for all day. ( if you will use it for download shaping)