Bug fix to topicmodel and environment