Fix mq-related bugs