Notification bug

Here are some tests that trigger bug #4496 and might help debugging it.