Fixed a bug in the reasoner