Fixed a bug in the logics.