Fixed badly indented lines.

Some code (mainly python) was indented badly and mixed tabs and spaces. I've 'fixed' these lines and changed tabs to spaces.