Fixes #2431, #2452, a little bit lex talionis, but appropriate, I think.