Adding an assert, plus a conversion of malloc to calloc