Fix setting zero values on NULL

Fixes #7