Fixed bug introduced in last commit due to poor checking of undefined vs
null