Fixing misc. bugs.

* Correcting imports to correctly wrap the depends of the imports.
* Fixing bug in c/c++ library linking.
* Fixing bug in python code generation.