Do not return unitialized random stack content in the error case

return undef then