Patches master

Last PR from me for this week, will be on PTO the rest of the week. Martin will send his work to you directly from now on.