Minor fixes: spelling + unused imports/variables

I've tidied up the easy bits as I found them.
Most of the unused variables initiations where removed (```var = None```) since they are properly initiated only a few lines further.

Maybe there was even a bug where previously ```error_ret``` was initiated with ```None``` but ```err_ret``` was set.