Fixed warning regarding testing for None