Includes a followup to !2109 (merged).
@gabi-250, please review and approve, but I'll do all merging.