3.12: update to latest mainline, fix merge conflicts

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>