Fixed Alert handling and added support for CLOSE_NOTIFY.