`toJSON` implementation for new MQ and small fixes