Fixes multithreading
Minor fixes
PEP8 (2-space indentation kept)
Indentation changed to 4 spaces
Merge pull request #3 from remram44/master

Fixes