small fixes for malloc