Fix all the warnings except one (which is caused by debug code)