Some fixes to make alerts work