Fixing some men leak/alloc. issues