Fix some issues on alerts handler