Merge Peter Feigl's patches