Fixed right return codes.
Fix return code.
Fixed right errno return.
Fix right return code.