Fix null and primitive value check