fix the bug of null value for primitive types