Added flags, updated the database and some overal fixes