Fixed a bug where document topic inference did not work correclty