Fixed as many warnings as possible