Switched to checked versions of malloc, calloc and free