Fixed minor structures and added flash messages