Add a test for null

Adapted and simplified from a pull request by Ramses de Norre.