1. support DATA_TYPE_MISMATCH and UNEXPECTED_NULL_VALUE explicitly, 2. add tests