Null ref test added in constructor