Fix null exception for comparison.