fixed compiling issues and some python issues