Fixed some injection issues. Added more logging functions.
Python fixes.