Changes os update algorithm
Fixed tests when a unittest break and won't clean the database.