This has now been fixed for the next version of Emacs (by commit 64db0c26faba21e7aedc0c5f57e04ed175b04f5b in master).

Thanks for the report!

-- Simen