Fix boolean check