Corrected handling of null.

Would be better to use Option. It is todo.