Releasing 3.7.7

I would like to release a 3.7.7 soon, with the following patches:

Let me know if you see other bug fixes which look safe enough to backport.