merge Christoph's fixes up to version 2.22