bugfixes + removed unused stuff