Fix null check issue with 0