Code cleanup. All Python warnings removed