Bug fix in modeling