Fix null detections to operate on the string representation.

A value was previously declared NULL if it was equal to NULL.
This doesn't work for integer, because 0 equal NULL.
The test operates on the buffer representation instead.
Fix #23