Merge some fixes from forks

Perhaps you would like to merge some of the fixes implemented by @stucki, @frans-beech-it, @alex-boehm and @fnagel.