Fixed checking equality