Errno fixes by @mrose17