Small bug fix, must check calloc result