Some better use of with-current buffer

I didn't push it directly because those are realy old code, but I see no way this could break.