cleaning and bugfixing

Mailny cleanup from former refactoring + small bugfixes..