Fix some python issues