Fix minor bugs in Logic class