fixed some malloc/calloc things