Fixes to errno and kernel malloc.