Updated NULL test to use empty()