Improvements checking returned value