Patch updated from thiloplanz comments