Added Alert functionality, various bugfix.