Bugfixes part 1