many major bugfixes