More allocation fixes