Added MsgAlert and fix a few crashes