Update patch based on Gerd's comments