Proper return code check