Remove errors and some warnings