Merge some bugfixes