FIX Several small fixes

* Docstring correction
* Counter instead of len()
* Use deepcopy
* PEP8 and pyflakes fixes