Fix a bunch of stuff

... among other things, too long lines which pylint is whining about. We
refered to an exception that didn't exist. Rename/move stuff around.

Part of #274 and probably some other bug as well ;)