bugfixes
lots more bugfixes