more fixes for malloc