Remove errors and most warnings