Some warnings fixed, some code removed