Fixed mark all function
Many fixes in various parts