Added notnil test for issue #1216