Tested by ajacoutot@, jasper@, krw@, shadchin@. I believe that the bugs spotted by krw@ are fixed in an upcoming inputproto update.